package com.yum.Iterator.Map;

import com.yum.Iterator.Collection.YCollection;
import com.yum.Iterator.Set.YSet;

import java.util.Map;
import java.util.function.BiConsumer;

public interface YMap<K,V>{

    YCollection<V> values();

    void putAll(YMap<? extends K,? extends V> m);

    int size();

    V get(K key);

    V put(K key,V value);

    void clear();

    V remove(K key);

    boolean containsKey(K key);

    boolean contatinsValue(V value);

    boolean isEmpty();

    YSet<K> keySet();

    YSet<YMap.YEntry<K,V>> entrySet();

    default void forEach(BiConsumer<? super K,? super V> action){
        if(action == null)
            throw new NullPointerException();
        for(YMap.YEntry<K,V> entry:entrySet()){
            K key;
            V value;
            key = entry.getKey();
            value = entry.getValue();
            action.accept(key,value);
        }
    }

    interface YEntry<K,V>{

        K getKey();

        V getValue();

        V setValue(V value);

        boolean equals(Object o);

        int hashCode();



    }


}
